<script setup lang="ts">
import { useRouter } from "vue-router";
defineProps({
  text: {
    type: String,
    default: 'MORE'
  },
  path: {
    type: String,
    default: ''
  },
})
const router = useRouter()
const handleClick = (src: string) => {
  if (!src) return
  router.push(src)
}
</script>

<template>
  <div class="more-btn" @click="handleClick(path)">{{ text }}</div>
</template>

<style lang="scss" scoped>
.more-btn {
  position: relative;
  width: 174px;
  height: 34px;
  line-height: 34px;
  display: block;
  font-size: 14px;
  text-align: center;
  color: #838383;
  border: #c6c6c6 1px solid;
  border-radius: 30px;
  transition: all ease-out 0.3s;
  cursor: pointer;

  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 174px;
    height: 34px;
    line-height: 34px;
    border: 2px solid #626675;
    opacity: 0;
    transition: all 0.5s ease 0s;
    margin: 0 auto;
    text-align: center;
    transform: scale(1, 1);
    margin-left: -3px;
    border-radius: 90px;
  }

  &:hover {
    color: #5e5e5e;
    border-color: transparent;

    &::after {
      opacity: 1;
      transform: rotateX(180deg);
    }
  }
}
</style>